package com.itheima.demo.demo09;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;

public class OutPut01 {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("D:\\bbb\\aaa\\ccc\\新建.txt",true);
        fos.write(67);
        fos.write(97);
        fos.write(122);
        byte[] b="你好".getBytes();
        System.out.println(Arrays.toString(b));
        fos.write(b);
        fos.close();
        FileInputStream fis=new FileInputStream("D:\\bbb\\aaa\\ccc\\新建.txt");
        int bb=0;
        //bb=fis.read()这段代码：
                        //fis.read读取数据
                        //将读取的值赋给变量b，然后再做比较
        while ((bb=fis.read())!=-1){
            System.out.println((char) bb);
        }
            fis.close();


    }
}
